package com.abase.site.client;


import com.google.gwt.event.logical.shared.ValueChangeHandler;

public class PocAbaseHistoryHandler implements ValueChangeHandler<String> {
	
	public static enum HistoryTokens {
	    HOME_TOKEN("/home"),
	    PRIVATE_HOME_TOKEN("/intranet"),
	    
	    HISTORY_TEST_TOKEN("/test");

	    private final String value;

	    private HistoryTokens(final String value) {
	      this.value = value;
	    }

	    public String getValue() {
	      return this.value;
	    }
	  }

	  /**
	   * check if the token is present in historyTokens list
	   * @param token
	   * @return boolean
	   */
	  public static boolean contains (final String token) {
	    boolean contains = false;
	    for (final HistoryTokens maiaHistory : HistoryTokens.values()) {
	      if (maiaHistory.getValue().equals(token)) {
	        contains = true;
	      }
	    }
	    return contains;
	  }


	  public void onValueChange(final com.google.gwt.event.logical.shared.ValueChangeEvent<String> event) {
	  }
	}
